package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseData;
import com.cskaoyan.bean.BaseParam;
import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.comment.MarketComment;
import com.cskaoyan.bean.goods.MarketGoods;
import com.cskaoyan.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Hu
 * @create 2021-09-17 16:14
 * @Description
 */


@RestController
@RequestMapping("admin/comment")
public class CommentController {

    @Autowired
    CommentService commentService;

    @RequestMapping("list")
    public BaseRespVo list(BaseParam baseParam, Integer userId, Integer valueId) {
        BaseData<MarketComment> result = commentService.list(baseParam, userId, valueId);
        return BaseRespVo.ok(result);
    }


    @RequestMapping("delete")
    public BaseRespVo delete(@RequestBody MarketComment marketComment) {
        Integer id = marketComment.getId();
        commentService.delete(id);
        return BaseRespVo.ok();
    }

}
